import requests
from common.get_assert import getASSERT
from common.get_token import getLP


def staff_add():
    token=getLP()
    re=requests.post(url="http://ihrm2-test.itheima.net/api/sys/user",
                     headers={"Content-Type":"application/json",
                              "Authorization":token},
                     json={"username":"zhaen",
                           "mobile":"13998839045",
                           "workNumber":"1"})
    print(re.json())
    getASSERT(200,True,10000,"成功",re)

if __name__ == '__main__':
   staff_add()
# def staff_modify():
#     token=getLP()
#     re=requests.put(url="http://ihrm2-test.itheima.net/api/sys/user/id",
#                      headers={"Content-Type":"application/json",
#                               "Authorization":token},
#                      json={"username":"zhaa"})
#     print(re.json())
#
#     assert 200 == re.status_code
#     assert True == re.json().get('success')
#     assert 10000 == re.json().get('code')
#     assert "成功" in re.json().get('message')
#
# def staff_search():
#     token=getLP()
#     re=requests.post(url="http://ihrm2-test.itheima.net/api/sys/id",
#                      headers={"Content-Type":"application/json",
#                               "Authorization":token})
#     print(re.json())
#
#
#     assert 200 == re.status_code
#     assert True == re.json().get('success')
#     assert 10000 == re.json().get('code')
#     assert "成功" in re.json().get('message')
# #
# def staff_delete():
#     token=getLP()
#     re=requests.post(url="http://ihrm2-test.itheima.net/api/sys/id",
#                      headers={"Content-Type":"application/json",
#                               "Authorization":token})
#     print(re.json())
#
#
#     assert 200 == re.status_code
#     assert True == re.json().get('success')
#     assert 10000 == re.json().get('code')
#     assert "成功" in re.json().get('message')
#
#
